<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/3/1
 * Time: 17:26
 */

namespace app\common\validate;


use think\Validate;

class User extends Validate
{
    protected $rule = [
        'phone|电话号码'=>'require|length:11',
        'password|密码'=>'require',
        'openid'=>'require'
    ];

    /**
     * 电话注册
     */
    public function scenePhone()
    {
        return $this->only(['phone','password']);
    }

    /**
     * 微信注册
     */
    public function sceneWx()
    {
        return $this->only(['openid']);
    }
}